package cn.edu.ncu.housinghub.vo;

public class Result {
    private String code;//1:成功；-1：失败
    private String message;//失败信息
    private Object data;//封装的数据
    public static Result success(){
        Result result = new Result();
        result.setCode("200");
        return result;
    }
    public static Result success(Object data){
        Result result=new Result();
        result.setCode("200");
        result.setData(data);
        return result;
    }
    public static Result error(Integer code,String message){
        Result result=new Result();
        result.setMessage(message);
        result.setCode(code.toString());
        return result;
    }

    private Result() {
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
